<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CrateBooksChapterTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('books_chapter', function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->string('name')->nullable()->comment('章节名称');
            $table->integer('word_count')->default(0)->comment('章节字数');
            $table->integer('books_info_id')->default(0)->comment('读物id');
            $table->integer('audio_id')->default(0)->comment('音频id');
            $table->longText('content')->nullable()->comment('章节内容');
            $table->tinyInteger('status')->default(0)->comment('桩体 0：下架 1：上架');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
